home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
10,000 Great Games
/
10,000 Great Games.iso
/
Product
/
66
/
data1.cab
/
Source_Files
/
Src
/
Crate.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2000-01-16
|
655b
|
38 lines
#include "stdafx.h"
cCrate::cCrate(int _x, int _y, cProperties *_orig)
: cWeapon(_x, _y, _orig, "MOVING")
{
move_object_after_hit = FALSE;
ASSERT(!crate_contents_list.is_empty());
}
cCrate::~cCrate()
{
}
int cCrate::control()
{
cWeapon::control();
bounce_on_boundaries();
// If hit drop stuff down
if (explode)
{
int n = orig->params->get_int("*OBJECTS_INSIDE", 5);
for (int i = 0; i < n; i++)
{
cFalling *f = new cFalling (x, y, crate_contents_list.get_random());
f->add_angular_speed(150, (96 + i * 192 / (n - 1)) & 255);
}
return FALSE;
}
return !in_water();
}